namespace SampleApplication.CoffeeShopSample.Implementation.Application.CommandsParsers
{
    #region Usings

    using Dependencies.Application;
    using Domain;
    using System;

    #endregion Usings

    public class OrderTeaCommandParser : ICommandParser
    {
        private readonly MakeTeaCommand makeTeaCommand;

        public OrderTeaCommandParser(MakeTeaCommand makeTeaCommand)
        {
            if (makeTeaCommand == null) throw new ArgumentNullException("makeTeaCommand");

            this.makeTeaCommand = makeTeaCommand;
        }

        public ICommand Parse(string command)
        {
            return "2".Equals(command) ? makeTeaCommand : null;
        }
    }
}